//
//  KKADManager.h
//  HybidMediation
//
//  Created by jay Win on 2019/9/17.
//  Copyright © 2019 jay Win. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "MaxAdManager.h"
#import "MopubAdMangaer.h"
#import <BUAdSDK/BUAdSDK.h>
#import "ByteDanceAdsManager.h"
#import <AdSupport/AdSupport.h>
NS_ASSUME_NONNULL_BEGIN
@class  KKADManager;

//for untiy and laya send message
@protocol AdsStateDelegate <NSObject>
-(void)onAdsListener:(NSString *)adsState;
@end


@interface KKADManager : NSObject
@property (nonatomic, strong) id<AdsStateDelegate>delegate;
@property (nonatomic, strong) BaseADController *baseController;
@property (nonatomic, strong) NSDictionary *adsConfig;
@property (nonatomic, strong) UIViewController *rootViewController;
@property int defalutMedationType;

@property int maxRecycleRequestInterstitialTimes;//最大循环请求插屏的次数
@property int currentlyRecycleRequestInterstitialTimes;//当前循环请求插屏的次数
@property int maxRecycleRequestRewardVideoTimes;//最大循环请求激励的次数
@property int currentlyRecycleRequestRewardVideoTimes;//当前循环请求激励的次数


@property int autoPlay;//激励广告加载成功自动播放

+(instancetype)shareInstance;

/// 初始化广告
/// @param useLocalConfig 是否使用本地配置
/// @param debug 是否显示调试日志
-(void)initAds:(BOOL)useLocalConfig debugModel:(BOOL)debug;

-(void)agreeGDPR:(BOOL)status;
-(void)agreeCOPPA:(BOOL)status;


/// 加载开屏广告
/// @param rootViewController 落地页
-(void)loadSplash:(UIViewController *)rootViewController customView:(UIView*__nullable)logoView;
-(void)loadSplash:(UIViewController *)rootViewController customView:(UIView*__nullable)logoView onImpressionEvent:(NSString *(^)(void))onImpression onFailedEvent:(NSString *(^)(void))onFailed;



/// 展示banner广告
/// @param rootViewController 落地也
/// @param containner banner容器
/// @param position 位置（顶部或者底部）
-(void)showBanner:(UIViewController *)rootViewController bannerContainer:(UIView *)containner isTop:(BOOL)position;

/// 展示banner广告
/// @param rootViewController 落地也
/// @param containner 容器
/// @param onImpression banner显示时候的回调事件
-(void)showBanner:(UIViewController *)rootViewController bannerContainner:(UIView *)containner onImpressionEvent:(void(^)(void))onImpression;


/// 关闭banner
-(void)hideBanner;



/// 判断插屏广告是否加载完成
-(BOOL)hasInterstitial;


/// 播放插屏广告
/// @param rootViewController 落地页
-(void)showInterstitial:(UIViewController *)rootViewController;


/// 播放插屏广告
/// @param rootViewControoler 落地页
/// @param onOpen 打开的回调事件
/// @param onClose 关闭的回调事件
-(void)showInterstitial:(UIViewController *)rootViewControoler
            onOpenEvent:(void(^)(void))onOpen
           onCloseEvent:(void(^)(void))onClose;



/// 判断激励视频是否加载完成
-(BOOL)hasRewardVideo;

/// 播放激励视频
/// @param rootViewController 落地页
-(void)showRewardVideo:(UIViewController *)rootViewController;


/// 播放激励视频
/// @param rootViewController 落地页
/// @param onOpen 打开的回调
/// @param onClose 关闭的回调（中途退出）
/// @param onComplete 激励广告观看完成
-(void)showRewardVideo:(UIViewController *)rootViewController
           onOpenEvent:(void(^)(void))onOpen
          onCloseEvent:(void(^)(void))onClose
       onCompleteEvent:(void(^)(void))onComplete;



/// 打开激励视频加载完成后自动播放
/// @param autoPlay 自动播放
-(void)setRewardVideoAutoPlayWhenLoaded:(BOOL)autoPlay;

@end

NS_ASSUME_NONNULL_END
